home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01b.txt / 000123_icon-group-sender_Thu Aug 2 12:32:02 2001.msg < prev    next >
Internet Message Format  |  2002-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id f72JVWk29688
  4.     for icon-group-addresses; Thu, 2 Aug 2001 12:31:32 -0700 (MST)
  5. Message-Id: <200108021931.f72JVWk29688@baskerville.CS.Arizona.EDU>
  6. From: Chris.D.Tenaglia@jci.com
  7. Subject: Re: list processing
  8. To: dodo@hotmail.com
  9. Cc: icon-group@cs.arizona.edu
  10. Date: Thu, 2 Aug 2001 11:02:48 -0500
  11. X-MIMETrack: Serialize by Router on jwimkrs1.na.jci.com/NA/Johnson_Controls(Release 5.07a
  12.  |May 14, 2001) at 08/02/2001 11:24:48 AM
  13. Errors-To: icon-group-errors@cs.arizona.edu
  14. Status: RO
  15. Content-Length: 1750
  16.  
  17. procedure main(param)
  18.   renlist := param[1]
  19.   (in := open(renlist)) | stop("Can't read ",renlist)
  20.   every line := !in do
  21.      {
  22.       old := parse(line,'\' ')[1]
  23.       new:=parse(line,'\' ')[2]
  24.       command := "ren " || old || " " new
  25.       write(command)
  26.       system(command)
  27.      }
  28.   close(in)
  29.   write("Process completed.")
  30.   end
  31.  
  32. procedure parse(line,delims)
  33.   static chars
  34.   chars  := &cset -- delims
  35.   tokens := []
  36.   line ? while tab(upto(chars)) do put(tokens,tab(many(chars)))
  37.   return tokens
  38.   end
  39.  
  40.  
  41.  
  42.                                                                                                                
  43.                     dodo@hotmail.                                                                              
  44.                     com                  To:     icon-group@CS.Arizona.EDU                                     
  45.                                          cc:                                                                   
  46.                     08/02/01             Subject:     list processing                                          
  47.                     12:09 AM                                                                                   
  48.                                                                                                                
  49.                                                                                                                
  50.  
  51.  
  52.  
  53.  
  54. hello
  55. i need to rename a number of files (approx 120)
  56. all files to be renamed are in the same directory
  57. i have a list with entries like this:
  58. 'name1' 'newname1'
  59. 'name2' 'newname2'
  60. .
  61. .
  62.  
  63. How can i force msdos REName to accept name, newname as parameters ?
  64. (i use  Icon Version 9.3.2.  July 1, 1999 for msdos)
  65. Can you give me a hint ?
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.